import { Helper } from  "../../Helper"

Page<{
  helper: Helper,

  SDKVersion?: string,
  url: string,
  userName: string,
  totp: string,
}>({
  data: {
    helper: new Helper(),

    SDKVersion: '',
    url: '',
    userName: '',
    totp:'',
  },
  onLoad(query) {
    //get data from remote 
    console.log(this.data.helper.getUrl())
    
    // 页面加载
    console.info(`Page onLoad with query: ${JSON.stringify(query)}`);
  },
  onReady() {
    // 页面加载完成
  },
  onShow() {
    // 页面显示
    this.setData({
      SDKVersion: my.SDKVersion,
      url: this.data.helper.getUrl(),
      userName: this.data.helper.getUserName(),
      totp: this.data.helper.getTotpInfo().toString(),
    })
  },
  onUnload() {
    // 页面被关闭
  },
  onTitleClick() {
    // 标题被点击
  },
  onPullDownRefresh() {
    // 页面被下拉
  },
  onReachBottom() {
    // 页面被拉到底部
  },
  onShareAppMessage() {
    // 返回自定义分享信息
    return {
      title: 'My App',
      desc: 'My App description',
      path: 'pages/index/index',
    };
  },
});
